package com.kaka.service.serviceimpl;

import com.kaka.mapper.ProductMapper;
import com.kaka.pojo.Product;
import com.kaka.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    ProductMapper productMapper;

    @Override
    public List<Product> selectAll(String productName) {
        return productMapper.selectAll(productName);
    }

    @Override
    public Product selectById(Integer id) {
        return productMapper.selectById(id);
    }

    @Override
    public void updateProduct(Product product) {
        productMapper.updateProduct(product);
    }

    @Override
    public void insertProduct(Product product) {
        productMapper.insertProduct(product);
    }

    @Override
    public void deleteProductById(Integer id) {
        productMapper.deleteProductById(id);
    }

    @Override
    public void deleteProductByIds(List<Integer> ids) {
        productMapper.deleteProductByIds(ids);
    }
}
